package com.home.facade;

import com.home.dao.AccountDao;
import com.home.model.dto.AccountDto;

public class AccountFacade {
	private AccountDao accountDao = new AccountDao();
	
	public AccountDto isValidLogin(String username, String password) {
		accountDao.beginTransaction();
		AccountDto acc = accountDao.findAccountForLogin(username, password);
		if (acc == null || !acc.getPassword().equals(password)) {
            return null;
        }
		
		return acc;
	}
}
